#@layout()
#define script()
<script>
    $.ajax({
        url: "http://47.105.208.60:8080/wechat-api/product/findAllProductSite"
        //url: "http://localhost:8080/wechat-api/product/findAllProductSite"
        , dataType: 'json'
        , type: 'POST'
        , success: function (data) {
            if (data.code == 0) {
                var infos = data.info;
                if (infos != null && infos != "") {
                    $(infos).each(function () {
                        var content = "<tr id='tr' class='tr'>"+
                            "<td style='table-layout:fixed'>"+this.eid+"</td>"+
                            "<td style='table-layout:fixed'>"+this.name+"</td>"+
                            "<td style='table-layout:fixed'>"+this.address+"</td>"+
                            "<td style='table-layout:fixed'>"+this.report+"</td>"+
                            "<td style='table-layout:fixed' onclick='binding(" + this.id + ")'>绑定</td>"+
                            "</tr>";
                        $("tbody").append($(content));
                    })
                }
            }
            else
            {
                console.log("========")
                alert("操作失败");//请求传输失败回调函数
            }
        }
        , error: function (msg) {
            console.log("----------")
            alert(msg); //错误信息

        }
    });

    function binding(id) {
        $.ajax({
            url: "http://47.105.208.60:8080/wechat-api/product/binding?aId=#(id ??)&&tId=" + id
            //url: "http://localhost:8080/wechat-api/product/binding?aId=#(id ??)&&tId=" + id
            , dataType: 'json'
            , success: function (data) {
                if (data.code == 0) {
                    alert("绑定成功");
                }
                else
                {
                    console.log("========")
                    alert("操作失败");//请求传输失败回调函数
                }
            }
            , error: function (msg) {
                console.log("----------")
                alert(msg); //错误信息

            }
        });
    }
</script>

#end

#define content()
<div class="content-wrapper">

    <section class="content-header">
        <h1>
            淘山货大市地点管理
            <!--<small>Article Management</small>-->
        </h1>
    </section>


    <section class="content">

        <div class="row">
            <div class="col-xs-12">
                <div class="box box-primary">
                    <div class="box-body ">

                        <table class="table table-striped">
                            <thead>
                            <tr>
                                <th>地点编号</th>
                                <th>地点名字</th>
                                <th>地点地址</th>
                                <th>申报人</th>
                                <th style="width: 90px">操作</th>
                            </tr>
                            </thead>
                            <tbody>

                            </tbody>
                        </table>
                    </div>
                    <!-- /.box-body -->
                    <div class="box-footer">
                        <div class="row">
                            <div class="col-sm-12">
                                #@_paginate()
                            </div>
                        </div>
                    </div>
                </div>
                <!-- /.box -->
            </div>
        </div>

    </section>


</div>
#end
